package com.xingzhengfan.eurekaclient;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataSourceConfig {
    @Bean("druidDataSource")
    public DruidDataSource druidDataSource() {
        DruidDataSource dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mysql://210.22.173.210:32306/truecash_rca");
        dataSource.setDriverClassName("");
        dataSource.setMaxActive(100);
        dataSource.setMaxWait(60000);
        dataSource.setUsername("root");
        dataSource.setPassword("654321");
        dataSource.setRemoveAbandoned(true);
        dataSource.setTimeBetweenEvictionRunsMillis(300000);
        dataSource.setValidationQuery("SELECT 1");
        dataSource.setTestWhileIdle(true);
        dataSource.setTestOnBorrow(false);
        dataSource.setTestOnReturn(false);
        return dataSource;
    }
}
